home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / PROLOG / HUMBOLT / HUMBOLTS / _files / _humboltsr / FILES._h < prev    next >
Text File  |  1990-06-10  |  3KB  |  100 lines

  1. /***************************************************
  2. ****************************************************
  3. **                                                **
  4. **  HU-Prolog     Portable Interpreter System     **
  5. **                                                **
  6. **  Release 1.62   January  1990                  **
  7. **                                                **
  8. **  Authors:      C.Horn, M.Dziadzka, M.Horn      **
  9. **                                                **
  10. **  (C) 1989      Humboldt-University             **
  11. **                Department of Mathematics       **
  12. **                GDR 1086 Berlin, P.O.Box 1297   **
  13. **                                                **
  14. ****************************************************
  15. ***************************************************/
  16.  
  17. #include "window.h"
  18.  
  19. #if !BIT8
  20. #define MAXFILES         20
  21. #define BUFLENGTH        85
  22. #endif
  23. #if BIT8
  24. #define MAXFILES         6
  25. #define BUFLENGTH        16
  26. #endif
  27.  
  28. typedef struct {
  29.      TERM f_name;
  30.      ATOM f_log_name;
  31.      int f_in_ptr;                      /* os file pointer */
  32.      int f_out_ptr;
  33.      WIN f_win_ptr;                     /* window pointer */
  34.      TERM f_list_ptr;
  35.      card f_type;
  36.      boolean f_is_eof;   /* end of file */
  37.      boolean f_is_a_tty; /* is a tty */
  38.      boolean f_can_read; /* file is open for read */
  39.      boolean f_can_write; /* file is open for write*/
  40.      boolean f_is_inputfile;  /* file is currently used as inputfile */
  41.      char f_buffer[BUFLENGTH];
  42.      int  f_charpos;
  43.      int  f_length;
  44.      int  f_lineno;
  45.      } file_type;
  46.  
  47. extern file_type file_tab[];
  48.  
  49. #define FNAME(f)          file_tab[f].f_name
  50. #define FTYPE(f)          file_tab[f].f_type
  51. #define FINPTR(f)         file_tab[f].f_in_ptr
  52. #define FOUTPTR(f)        file_tab[f].f_out_ptr
  53. #define FWINPTR(f)        file_tab[f].f_win_ptr
  54. #define FLISTPTR(f)       file_tab[f].f_list_ptr
  55. #define FLOGNAME(f)       file_tab[f].f_log_name
  56.  
  57. #define ISEOF(f)            file_tab[f].f_is_eof
  58. #define ISTTY(f)          file_tab[f].f_is_a_tty
  59. #define CANREAD(f)        file_tab[f].f_can_read
  60. #define CANWRITE(f)       file_tab[f].f_can_write
  61. #define ISINPUT(f)        file_tab[f].f_is_inputfile
  62.  
  63. #define FBUFFER(f)        file_tab[f].f_buffer
  64. #define FCHARPOS(f)       file_tab[f].f_charpos
  65. #define FBUFLENGTH(f)     file_tab[f].f_length
  66. #define FLINENO(f)        file_tab[f].f_lineno
  67.  
  68. #define LINELENGTH       FBUFLENGTH(inputfile)
  69. #define CHARPOS          FCHARPOS(inputfile)
  70. #define LINEBUF          FBUFFER(inputfile)
  71. #define LINENUMBER       FLINENO(inputfile)
  72.  
  73. #define fmode            int
  74. #define write_mode       1
  75. #define read_mode        2
  76. #define read_write       3
  77. #define look_mode        4
  78.  
  79. #define file             int
  80. #define STDIN            0
  81. #define STDOUT           1
  82. #define STDERR           2
  83.  
  84. #define NOFILE           -1
  85. #define ERRFILE          -2
  86.  
  87. #define NORMFT           1
  88. #define WINDOWFT         2
  89. #define LISTFT           3
  90.  
  91. extern file inputfile,outputfile;
  92.  
  93. /* modes for buffered io */
  94. IMPORT void out_buffer();
  95. #define BUF_ON 1
  96. #define BUF_OFF 2
  97. #define BUF_FLUSH 3
  98.  
  99.  
  100.